package com.ysxm.entity;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Size;

import org.hibernate.validator.constraints.Range;

import com.fasterxml.jackson.annotation.JsonInclude;

@JsonInclude(JsonInclude.Include.NON_NULL)
public class User {
	private Integer uid;
	@Size(max = 8, message = "用户名不能大于8位")
	@NotEmpty(message = "请输入用户名")
	private String username;
	@Size(min = 6, max = 16, message = "密码不能小于6位且不能大于16位")
	@NotEmpty(message = "请输入密码")
	private String password;
	@NotEmpty(message = "请输入电话")
	@Size(min=11,max=11,message="请输入正确的电话格式")
	private String phone;
	@NotEmpty(message = "请输入邮箱")
	@Email(message = "请输入正确的邮箱格式")
	private String email;
	@NotEmpty(message = "请输入地址")
	private String address;
	private String secondPassword;
	private String userhead;

	public User() {

	}

	public User(String username, String password, String phone, String email, String address, String userhead
			) {

		this.username = username;
		this.password = password;
		this.phone = phone;
		this.email = email;
		this.address = address;
		this.userhead = userhead;
		

	}

	public Integer getUid() {
		return uid;
	}

	public void setUid(Integer uid) {
		this.uid = uid;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getUserhead() {
		return userhead;
	}

	public void setUserhead(String userhead) {
		this.userhead = userhead;
	}

	public String getSecondPassword() {
		return secondPassword;
	}

	public void setSecondPassword(String secondPassword) {
		this.secondPassword = secondPassword;
	}

	@Override
	public String toString() {
		return "User [uid=" + uid + ", username=" + username + ", password=" + password + ", phone=" + phone
				+ ", email=" + email + ", address=" + address + ", secondPassword=" + secondPassword + ", userhead="
				+ userhead + "]";
	}
}
